//
//  SignatureTableViewCell.m
//  Shengzhuli
//
//  Created by 卡忙科技 on 16/9/22.
//  Copyright © 2016年 kamangkeji. All rights reserved.
//

#import "SignatureTableViewCell.h"
#import "AddressField.h"

@interface SignatureTableViewCell()<UITextViewDelegate>

@property (nonatomic,weak) IBOutlet AddressField *signatureField;

@end

@implementation SignatureTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textDidChanged:) name:UITextViewTextDidChangeNotification object:nil];
}
- (void)textDidChanged:(NSNotification *)noti
{
    UITextView *textview = noti.object;
    self.info.personalizedSignature = textview.text;
}
- (void)setInfo:(PersonInfo *)info
{
    _info = info;
    if (info.personalizedSignature.length>0) {
        self.signatureField.text = info.personalizedSignature;
    }
    self.signatureField.placeHolder = @"请输入个人介绍";
}
- (void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UITextViewTextDidChangeNotification object:nil];
}
@end
